package hu.imind.phonecalc.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Text;

@SuppressWarnings("serial")
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class PhoneCalcUser implements Serializable {
    @PrimaryKey
    private String email;
    @Persistent
    private Text workNumbers;
    @Persistent
    private Text privNumbers;
    @Persistent
    private List<String> bills;

    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public Text getWorkNumbers() {
        return workNumbers;
    }
    public void setWorkNumbers(Text workNumbers) {
        this.workNumbers = workNumbers;
    }
    public Text getPrivNumbers() {
        return privNumbers;
    }
    public void setPrivNumbers(Text privNumbers) {
        this.privNumbers = privNumbers;
    }
    public List<String> getBills() {
        return bills;
    }
    public void setBills(List<String> bills) {
        this.bills = bills;
    }
    public void addBill(Bill bill) {
        if (bills == null) {
            bills = new ArrayList<String>();
        }
        bills.add(bill.getDate().toString());
    }
}
